<?php (defined('BASEPATH')) OR exit('No direct script access allowed');

function getAvatarLink($userId, $avatar)
{
    if ($avatar) {
        return base_url("upload/user/{$userId}/{$avatar}");    
    } else {
        return base_url('theme/images/frontend/user-default-avatar.jpg');
    }
}